import logging
from rich.logging import RichHandler
from rich.console import Console

# FORMAT = '%(message)s'# 显示内容的格式
# logging.basicConfig(level='NOTSET', format=FORMAT, datefmt='[%X]', handlers=[RichHandler()])
# log = logging.getLogger('rich')
# log.info('Hello World')


FORMAT = '%(levelname)s:%(message)s'
logging.basicConfig(level='NOTSET', format=FORMAT, datefmt='[%X]', handlers=[RichHandler()])# 这个与上边的比较可以知道，RichHandler()已经显示level了
log = logging.getLogger('rich')
log.info('Hello World')

console = Console()
console.log('Hello World')
